package com.designpatterns.singleton;

/**
 * 通过［静态内部类在使用的时候才会加载且加载过程本生是线程安全的］的原理来实现的单例模式
 * Created by mike on 18/1/1.
 */
public class StaticSingleton {
    private static class StaticTheadLocalObj{
        private static StaticSingleton obj = new StaticSingleton();
    }
    private StaticSingleton(){}
    public static  StaticSingleton getInstance() {
        return StaticTheadLocalObj.obj;
    }
}

